<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title></title>
    <script src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
    <script src="http://cdn.bootcss.com/jquery/2.2.1/jquery.min.js"></script>
</head>
<body>
<script>
    var getWxSign = function () {
        var wxUrl = encodeURIComponent(location.href.split('#')[0]);
        $.ajax({
            url: "http://api.mzg.so/V1.0.0/Weixin/Public/token/?callback=?&url=" + wxUrl,
            dataType: 'jsonp',
            success: function (obj) {
                obj = JSON.parse(obj);
                var appId = obj.data.app_id,
                        timestamp = obj.data.timestamp,
                        nonceStr = obj.data.noncestr,
                        signature = obj.data.signature;
                wx.config({
//                        debug: true,
                    appId: appId,
                    timestamp: timestamp,
                    nonceStr: nonceStr,
                    signature: signature,
                    jsApiList: [
                        'onMenuShareTimeline',
                        'onMenuShareAppMessage',
                        'onMenuShareQQ',
                        'onMenuShareWeibo'
                    ]
                });
                wx.ready(function () {
                    wx.checkJsApi({
                        jsApiList: [
                            'getNetworkType',
                            'previewImage'
                        ],
                        success: function (res) {
                            wx.hideOptionMenu();
                        }
                    });
                })
            }
        });
    };
    getWxSign();
</script>
</body>
</html>